package map.bean;

import com.baidu.mapapi.search.sug.SuggestionResult;

import java.util.Objects;

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/10/25 15:34
 */
public final class SuggestInfoWrap {

    private final SuggestionResult.SuggestionInfo suggestionInfo;

    private double distance;


    public SuggestInfoWrap(SuggestionResult.SuggestionInfo suggestionInfo, double distance) {
        this.suggestionInfo = suggestionInfo;
        this.distance = distance;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public SuggestionResult.SuggestionInfo getSuggestionInfo() {
        return suggestionInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SuggestInfoWrap that = (SuggestInfoWrap) o;
        return Objects.equals(suggestionInfo.key, that.suggestionInfo.key)
                && Objects.equals(suggestionInfo.address, that.suggestionInfo.address)
                && Objects.equals(suggestionInfo.tag, that.suggestionInfo.tag);
    }

    @Override
    public int hashCode() {
        return Objects.hash(suggestionInfo.key, suggestionInfo.address, suggestionInfo.tag);
    }
}
